Rails.application.routes.draw do

  get 'static_pages/about'

  get 'static_pages/contect'

  get 'static_pages/help'

  get 'tagsearchs/index'

  get 'searchs/index'

  get 'answers/new'

  get 'tags/new'

  get 'tags/create'

  get 'questions/index'

  get 'questions/new'

  get 'evaluaters/new'

  get 'messages/create'

  get 'messages/destroy'

  get 'messages/index'

  get 'messages/update'

  get 'factory_infos/new'

  post 'users/:user_id/factory_infos'=>'factory_infos#create'

  get 'factory_infos/show'
  get 'counselor_infos/show'
  get 'mydemand/:id'=>'users#mydemand'
  get 'myinfo/:id'=>'users#show'
  get 'mymessages'=>'users#mymessages'
  get 'editinfo'=>'users#editprofile'
  get 'welcome/index'
  get 'myfollowers/:id'=>'users#myfollowers'
  get 'myfollowing/:id'=>'users#myfollowing'
  get 'editprofile'=>'users#editprofile'
  # The priority is based upon order of creation: first created -> highest priority.
  # See how all your routes lay out with "rake routes".
  get 'login' => 'sessions#new'
  post 'login' => 'sessions#create'
  delete 'logout' => 'sessions#destroy'
  get 'register'=>'users#new'
  get 'myoffers/:id'=>'users#myoffers'
  get 'myquestions/:id'=>'users#myquestions'
  get 'myanswers/:id'=>'users#myanswers'
  post 'takeOrder'=>'offers#update'
  post 'finishDemand'=>'demands#update'
  get 'usercard/:id'=>'users#card'
  post 'follow'=>'users#follow'
  post 'unfollow'=>'users#unfollow'
  get 'changeavatar'=>'users#changeavatar'
  post 'changeavatar'=>'users#updateavatar'
  get 'about'=>'static_pages#about'
  get 'help'=>'static_pages#help'
  get 'contect'=>'static_pages#contect'
  get 'questions/:question_id/adopt/:answer_id'=>'questions#adopt'
  # You can have the root of your site routed with "root"
  root 'welcome#index'

  # Example of regular route:
  #   get 'products/:id' => 'catalog#view'

  # Example of named route that can be invoked with purchase_url(id: product.id)
  #   get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
  # Example resource route (maps HTTP verbs to controller actions automatically):
  resources :factory_infos,:counselor_infos,:searchs
  resources :evaluating, :evaluates,:messages,:tags,:answers
  resources :question_read_logs,only: [:create]
  resources :demand_read_logs,only: [:create]
  resources :questions do
    resources :answers,:question_read_logs
  end
  resources :demands do
    resources :offers,:deals,:demand_read_logs
  end
  resources :tags do
    get :demands,:questions
  end
  resource :praises,only:[:create]
  resources :account_activations, only: [:edit]
  resources :users do
    member do
      get :evaluating,:evaluates
      get :following, :followers
    end
  end

  # Example resource route with options:
  #   resources :products do
  #     member do
  #       get 'short'
  #       post 'toggle'
  #     end
  #
  #     collection do
  #       get 'sold'
  #     end
  #   end

  # Example resource route with sub-resources:
  #   resources :products do
  #     resources :comments, :sales
  #     resource :seller
  #   end

  # Example resource route with more complex sub-resources:
  #   resources :products do
  #     resources :comments
  #     resources :sales do
  #       get 'recent', on: :collection
  #     end
  #   end

  # Example resource route with concerns:
  #   concern :toggleable do
  #     post 'toggle'
  #   end
  #   resources :posts, concerns: :toggleable
  #   resources :photos, concerns: :toggleable

  # Example resource route within a namespace:
  #   namespace :admin do
  #     # Directs /admin/products/* to Admin::ProductsController
  #     # (app/controllers/admin/products_controller.rb)
  #     resources :products
  #   end
end
